package com.alwvfhp.pushlet;

import java.util.Random;

import nl.justobjects.pushlet.core.Event;
import nl.justobjects.pushlet.core.EventPullSource;
/**
 * 
  * @Description: TODO
  * @ClassName: MyPushlet
  * @author sujian
  * @date 2014年9月8日 下午5:25:37
  *
 */
public class MyPushlet extends EventPullSource {
	/**
	 * 设置间隔调用函数时间
	 */
	@Override
	protected long getSleepTime() {
		return 1000;
	}
	/**
	 * 处理事务的函数
	 */
	@Override
	protected Event pullEvent() {
		Event event = Event.createDataEvent("/demo/getval");
		Random r = new Random();
        event.setField("value", "demo--->"+r.nextLong());
		return event;
	}

}
